//
//  MenuErweimaViewController.m
//  Products_B
//
//  Created by lanou on 16/6/6.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuErweimaViewController.h"
#import "ZHScanView.h"
@interface MenuErweimaViewController ()

@end

@implementation MenuErweimaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //    ZHScanView *scanf = [ZHScanView scanView];
    ZHScanView *scanf = [ZHScanView scanViewWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height - 100)];
    scanf.promptMessage = @"您可以直接输入或者选择扫描二维码";
    [self.view addSubview:scanf];
    
    [scanf startScaning];
    
    [scanf outPutResult:^(NSString *result) {
        
      
        NSLog(@"%@",result);
        //  跳转到网页
        [self.navigationController popViewControllerAnimated:YES];
        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:result]];
        
    }];
    
    
}
#pragma mark - 当push的时候隐藏tabBar
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
